const BaseModel = require('./base_model.js');

class CouponVerificationLogModel extends BaseModel {}

CouponVerificationLogModel.CL = "ax_coupon_verification_logs";

CouponVerificationLogModel.DB_STRUCTURE = {
  _pid: 'string|true',
  _id: 'string|true|comment=验券记录ID',
  couponId: 'string|true|comment=券码ID',
  couponCode: 'string|true|comment=券码',
  platform: 'string|true|comment=平台',
  
  // 验券信息
  verifyTime: 'int|true|comment=验券时间',
  verifyBy: 'string|true|comment=验券人ID (管理员ID)',
  verifyResult: 'int|true|comment=验券结果: 1-成功, 0-失败',
  verifyMessage: 'string|false|comment=验券消息',
  
  // 订单信息
  orderId: 'string|false|comment=关联订单ID',
  orderAmount: 'int|false|comment=订单金额(分)',
  discountAmount: 'int|false|comment=优惠金额(分)',
  finalAmount: 'int|false|comment=最终支付金额(分)',
  
  // 用户信息
  userId: 'string|false|comment=用户ID',
  userPhone: 'string|false|comment=用户手机号',
  
  // 门店信息
  storeId: 'string|false|comment=门店ID',
  storeName: 'string|false|comment=门店名称',
  
  // 平台响应
  platformResponse: 'object|false|comment=平台API响应数据',
  platformError: 'string|false|comment=平台错误信息',
  
  createTime: 'int|true|comment=创建时间',
  updateTime: 'int|true|comment=更新时间',
};

CouponVerificationLogModel.VERIFY_RESULT = {
  FAILED: 0,   // 失败
  SUCCESS: 1   // 成功
};

module.exports = CouponVerificationLogModel;
